<template>
    <div class="searchBar">
        <div class="navBar">
            <ul>
                <li :class="props.activeIndex == 0 ? 'active' : ''" @click="changeNav(0)">
                    <span>值班排班</span>
                </li>
                <li :class="props.activeIndex == 1 ? 'active' : ''" @click="changeNav(1)">
                    <span>日常管理</span>
                </li>
            </ul>
        </div>
        <div class="content">
            <div class="left">
                <el-form class="form" :model="searchData.params" label-position="left">
                    <el-form-item label="年份">
                        <el-date-picker v-model="searchData.params.year" type="year" placeholder="请选择年份" />
                    </el-form-item>
                    <el-form-item label="突出显示">
                        <el-radio-group v-model="searchData.params.standOut">
                            <el-radio :value="1">一值</el-radio>
                            <el-radio :value="2">二值</el-radio>
                            <el-radio :value="3">三值</el-radio>
                            <el-radio :value="4">四值</el-radio>
                        </el-radio-group>
                    </el-form-item>
                </el-form>
            </div>
            <div class="right">
                <div class="btn_bg" title="搜索" @click="searchList">
                    <img class="btn_icon search_icon" src="@/assets/images/images_new/search_icon.png" alt="">
                </div>

            </div>
        </div>
    </div>
</template>

<script setup lang="ts">

const props = defineProps({
  activeIndex:{
    type:Number,
    default:0
  }
})

let searchData = reactive({
    params: {
        year: "",//年份
        standOut: 1,//突出显示
    } as any
})


let emit = defineEmits(['changeNav'])

const changeNav = (index: number) => {
    if (props.activeIndex != index) {
        emit('changeNav',index)
    }

}

//查找
const searchList = () => {

}
</script>

<style lang="scss" scoped>
.searchBar {
    background-color: #fff;
    border-radius: 0px 0px 8px 8px;
    padding: 28px 0px 20px 30px;
    height: 144px;
    flex-basis: 144px;
    .navBar {
        ul {
            // width: 320px;
            display: flex;
            // border: 1px solid rgb(229, 229, 229);

            li {
                width: 160px;
                height: 38px;
                font-size: 16px;
                font-weight: 400;
                letter-spacing: 0px;
                line-height: 36px;
                // color: rgba(0, 0, 0, 1);
                color: rgb(112, 105, 95);
                text-align: center;
                cursor: pointer;
                position: relative;
                border-top: 1px solid rgb(229, 229, 229);
                border-bottom: 1px solid rgb(229, 229, 229);
                border-right: 1px solid rgb(229, 229, 229);

                &:first-child {
                    border-left: 1px solid rgb(229, 229, 229);
                }

                &.active {
                    width: 160px;
                    font-size: 16px;
                    line-height: 36px;
                    color: rgba(0, 0, 0, 1);
                    background: rgb(229, 229, 229);
                }
            }

        }
    }

    .content {
        padding-top: 26px;
        display: flex;
        padding-left: 8px;
        padding-right: 35px;

        .left {
            flex: 1;
            .el-form {
                .el-form-item {
                    padding-right: 50px;
                    .el-radio-group {
                        .el-radio {
                            margin-right: 20px;
                        }
                    }
                }
            }
        }

        .right {
            width: 35px;
            height: 32px;
            flex-shrink: 0;
            display: flex;
            justify-content: flex-start;
            align-items: center;

            .btn_bg {

                height: 35px;
                width: 35px;
                display: flex;
                justify-content: center;
                align-items: center;
                cursor: pointer;

                &:hover {
                    background: rgba(0, 0, 0, 0.1);
                    border-radius: 2px;
                }

                .search_icon {
                    width: 21px;
                    cursor: pointer;
                }
            }


        }
    }
}

// :deep(.el-date-editor) {
//     border: none !important;
// }
</style>
